﻿using Service.Domain.Entities.User;
using Service.Domain.Shared.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Service.Domain.Conventions.User
{
    public class ValidUserConvention : BaseConvention<UserInfo>
    {
        Expression<Func<UserInfo, bool>> expression = (user) => user.Status == UserStatus.Valid;

        public override Expression<Func<UserInfo, bool>> ToExpression()
        {
            return expression;
        }

        public override string ToSql()
        {
            return @$"{SqlPrefix}Valid = {(int)UserStatus.Valid}";
        }
    }
}
